USE [safe_manage]
GO

/****** Object:  Table [dbo].[tendency]    Script Date: 07/25/2012 23:19:27 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[tendency]( -- 事苗
	[ID] [int] NOT NULL, --problem.ID
	[TENDENCY_TYPE_ID] [int] NOT NULL,
	[LOSS] [varchar](2000) NOT NULL, --直接/间接经济损失
	[REASON] [varchar](5000) NOT NULL,--事苗原因
 CONSTRAINT [PK_TENDENCY] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [safe_manage]
GO

/****** Object:  Table [dbo].[defect]    Script Date: 07/27/2012 23:53:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[defect](
	[ID] [int] NOT NULL,
	[DEFECT_TYPE_ID] [int] NOT NULL,
	[LOSS] [varchar](2000) NOT NULL,
	[REASON] [varchar](5000) NOT NULL,
 CONSTRAINT [PK_defect] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO




USE [safe_manage]
GO

/****** Object:  Table [dbo].[defect_type]    Script Date: 07/26/2012 20:50:15 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[defect_type](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[DEFECT_TYPE] [varchar](100) NOT NULL,
 CONSTRAINT [PK_defect_type] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

USE [safe_manage]
GO

/****** Object:  Table [dbo].[tendency_type]    Script Date: 07/26/2012 20:51:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[tendency_type](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[TENDENCY_TYPE] [varchar](100) NOT NULL,
 CONSTRAINT [PK_tendency_type] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


insert into defect_type(DEFECT_TYPE) values('生产')
go

insert into tendency_type(TENDENCY_TYPE) values('火灾爆炸')
go


